package com.thrc.borrow.utils;

import java.util.HashMap;
import java.util.Map;

public class ReturnCode {

	public static String RETURN_CODE = "code";
	public static String RETURN_DATA = "data";
	public static String RETURN_MSG = "msg";
	public static String RETURN_DETAIL = "detail";

	public static String SUCCESS_MSG = "success";
	public static String FAIL_MSG = "fail";
	public static String ERROR_MSG = "error";

	public static int SUCCESS_CODE = 0;
	public static int FAIL_CODE = 1;
	public static int ERROR_CODE = -1;

	public static Map<Integer, String> retCodeMap = new HashMap<Integer, String>();

	static {
		retCodeMap.put(SUCCESS_CODE, SUCCESS_MSG);
		retCodeMap.put(FAIL_CODE, FAIL_MSG);
		retCodeMap.put(ERROR_CODE, ERROR_MSG);
	}

	public static String getCodeMsg(int code) {
		return retCodeMap.get(code);
	}

}
